package com.insigma.business.qrcode.welfare.dto;


import com.insigma.business.qrcode.common.vo.DescEnum;

import java.util.LinkedHashMap;
import java.util.Map;


public enum RecordTypeEnum implements DescEnum {

    
    MERCHANT("商家"),

    HOSPITAL("医院"),

    SCENIC_SPOT("景区"),

    ;

    RecordTypeEnum(String desc) {
        this.desc = desc;
    }

    
    private String desc;

    @Override
    public String getDesc() {
        return desc;
    }

    
    public static RecordTypeEnum getByEnumName(final String enumName) {
        for (RecordTypeEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return null;
    }

    
    public static Map<String,String> getName2DescMap(){

        Map<String,String> name2TitleMap = new LinkedHashMap<>();

        for (RecordTypeEnum element : values()) {
            name2TitleMap.put(element.name(), element.desc);
        }

        return name2TitleMap;
    }

}
